#ifndef TESTLOADING_H
#define TESTLOADING_H

#include <QWidget>
#include <QPaintEvent>
#include <QPainter>
#include <QGraphicsBlurEffect>
#include <QTimer>
#include "globaldef.h"

namespace Ui {
class TestLoading;
}

class TestLoading : public QWidget
{
    Q_OBJECT

public:
    explicit TestLoading(QWidget *parent = nullptr);
    ~TestLoading();

    void updateTips(const QString &tip);
    void start(int timeTotal, const QString &title, const QString &tip = tr("testing"));
    void stop();

protected:
    void paintEvent(QPaintEvent *event);

private slots:
    void updateProgressSlot();
    void show() {}
    void hide() {}

private:
    Ui::TestLoading *ui;
    QTimer * progressTimer;
    int progressVal;
    int timeTotal;
};

#endif // TESTLOADING_H
